/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86186
 * Date: 2023-09-12
 * Time: 18:05
 */
public class Test {
    public static void main(String[] args) {
        Thread c = new Thread(() -> {
            System.out.println(Thread.currentThread().getName());
        },"c");

        Thread b = new Thread(() -> {
            try {
                c.join();
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println(Thread.currentThread().getName());
        },"b");

        Thread a = new Thread(() -> {
            try {
                b.join();
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println(Thread.currentThread().getName());
        },"a");

        a.start();
        b.start();
        c.start();
    }
}
